// Tags:
#include <algorithm>
#include <cstdio>
#include <tr1/unordered_map>

const int N = 1e5 + 5;
int n, ans;
unsigned int maxn, a[N];
std::tr1::unordered_map<unsigned int, bool> map;

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("testdata.in", "r", stdin);
  freopen("testdata.out", "w", stdout);
#else
  freopen("f.in", "r", stdin);
  freopen("f.out", "w", stdout);
#endif
#endif

  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%u", &a[i]), maxn = std::max(maxn, a[i]);
  maxn <<= 1;
  for (int i = 1; i <= n; ++i) {
    unsigned int f1 = 1, f2 = 1, tmp;
    while (f1 <= maxn) {
      if (map.find(f1 - a[i]) != map.end()) {
        ++ans;
        map.clear();
        break;
      }
      tmp = f2, f2 = f1, f1 = f1 + tmp;
    }
    map[a[i]] = true;
  }
  printf("%d", ans + 1);
  return 0;
}